
import { Fragment, } from 'react'
import { Button, DatePicker } from 'antd';

const monthFormat = 'YYYY-MM-DD';

export default function AnnouncementSearch({ dataToChang,setAddOpen,role }) {

  return (
    <Fragment >
      <h1>西城公告</h1>
      <div className='search-date'>
        <DatePicker
          onChange={dataToChang}
          placeholder="请选择时间"
          // defaultValue={moment("2023-01-01", monthFormat)}
          format={monthFormat}
          size="small"
        />
        {
          role?.fd_type === "teacher" ? 
           <Button size='small' onClick={()=>setAddOpen(true)}>新增公告</Button> :
           ''
        }
      </div>
    </Fragment>
  )
}
